home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts26-11
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP! Compile Error!
- Date: Wed, 06 Mar 96 06:53:04 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4hjco8$elu@sam.inforamp.net>
- References: <4hi7vc$ggd@newsbf02.news.aol.com>
- NNTP-Posting-Host: ts26-11.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <4hi7vc$ggd@newsbf02.news.aol.com>,
- mrbig0233@aol.com (MrBig0233) wrote:
- >I am an 11-year-old (yes, no typo) programmer, and I am trying to write a
- >sorting program for a merit badge. I compile the program, and the error
- >is:
- >
- >SORT.CPP 7: Declaration terminated incorrectly
- >
- >This is the code:
- >
- >#include<conio.h>
- >#include<stdio.h>
- >#include<stdlib.h>
- >#include<time.h>
- >#include<string.h>
- >
- >{
- >
- > main()
- > randomize(num1);
- > randomize(num2);
- > randomize(num3);
- > randomize(num4);
- > randomize(num5);
- > if (strcmp(num1==<num2))
- > {
- > strcpy(num2,num1);
- > }
- > if (strcmp(num2==<num3))
- > {
- > strcpy(num3,num2);
- > }
- > if (strcmp(num3==<num4))
- > {
- > strcpy(num4,num3);
- > }
- > if (strcmp(num4==<num5))
- > {
- > strcpy(num5,num4);
- > }
- > printf("The numbers, in some order:\n");
- > printf("%d, %d, %d, %d, %d",num1,num2,num3,num4,num5);
- > return;
- >}
-
- Hey Mr Big! I think I can help you.
- Put the "main()" in front of the first '{' (bracket).
-
- Try...
- ------------------------------------------------------------
- #include<conio.h>
- #include<stdio.h>
- #include<stdlib.h>
- #include<time.h>
- #include<string.h>
-
- main()
- {
- randomize(num1);
- randomize(num2);
- randomize(num3);
- randomize(num4);
- randomize(num5);
- if (strcmp(num1==<num2))
- {
- strcpy(num2,num1);
- }
- if (strcmp(num2==<num3))
- {
- strcpy(num3,num2);
- }
- if (strcmp(num3==<num4))
- {
- strcpy(num4,num3);
- }
- if (strcmp(num4==<num5))
- {
- strcpy(num5,num4);
- }
- printf("The numbers, in some order:\n");
- printf("%d, %d, %d, %d, %d",num1,num2,num3,num4,num5);
- return;
- }
-